﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SmallJob.Data;
using SmallJob.Model;
using SmallJob.Services.Interfaces;
using SmallJob.Data.Interfaces;

namespace SmallJob.Services.Implements
{
    public class OfferMessageService : RepositoryBase<OfferMessage>, IOfferMessageService
    {
        public OfferMessageService(IDatabaseFactory DBFactory) : base(DBFactory) { }
        
        public List<OfferMessage> GetByOfferID(int id)
        {
            var result = from om in SmallJobDB.OfferMessages
                         where om.OfferID == id
                         orderby om.CreatedDate descending
                         select om;
            return result.ToList();
        }
    }
}
